//指针与函数
#include<iostream>
#include<string.h>

using namespace std;

void swap1(int a, int b)
{
	int temp = a;
	a = b;
	b = temp;
}

void swap2(int *a, int *b)
{
	int temp = *a;
	*a = *b;
	*b = temp;
	
}
int main()
{
	int a = 1;
	int b = 99;
	//swap1(a, b);
	swap2(&a, &b);
	cout << "a=" << a << endl;
	cout << "b=" << b << endl;
	system("pause");
	return 0;
}